package com.mazaiting.manager.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mazaiting.common.core.ex.exceptions.BaseException;
import com.mazaiting.common.core.ex.exceptions.BusinessException;
import com.mazaiting.common.core.ex.exceptions.EmptyObjectException;
import com.mazaiting.manager.domain.entity.SysDictType;
import com.mazaiting.manager.domain.form.DictTypeForm;
import com.mazaiting.manager.domain.query.DictTypePageQuery;
import com.mazaiting.manager.domain.vo.dict.DictTypePageVO;
import org.springframework.transaction.annotation.Transactional;

/**
 * 字典表服务类
 *
 * @author mazaiting
 * @since 2022-03-25
 */
public interface ISysDictTypeService extends IService<SysDictType> {

    /**
     * 根据查询参数查询字典
     * @param queryParams 查询参数
     * @return 字典分页数据
     */
    Page<DictTypePageVO> listPages(DictTypePageQuery queryParams);

    /**
     * 新增字典类型
     * @param dictTypeForm 字典表单
     * @return true: 新增成功; false: 新增失败
     */
    @Transactional
    boolean save(DictTypeForm dictTypeForm) throws BusinessException;

    /**
     * 修改字典类型
     * @param dictTypeForm 字典表单类型
     * @return true: 修改成功; false: 修改失败
     */
    @Transactional
    boolean update(DictTypeForm dictTypeForm) throws BaseException;

    /**
     * 删除字典类型
     * @param ids 字典 ID. 字典类型ID，多个以英文逗号(,)分割
     * @return true: 删除成功; false: 删除失败
     */
    @Transactional
    boolean delete(String ids);

    /**
     * 字典类型表单详情
     * @param id 字典ID
     * @return 表单详情
     */
    DictTypeForm getDictTypeFormData(Long id) throws EmptyObjectException;
}
